package week5;

/**
 * Created by dell on 2017/3/25.
 */
class Father {
    void test() throws ClassCastException { // 运行时异常
        System.out.println("父类");
        throw new ClassCastException();
    }
}

class Son extends Father {
    void test() {
        System.out.println("子类");
    }
}
public class Demo1 {
    public static void main(String[] args) {
        Father f = new Son();
        f.test();
    }
}